From: Sam Steingold Date: Wed, 21 Mar 2012 17:17:23 +0000 (-0400) Subject: * lisp/progmodes/etags.el (tags-completion-at-point-function): X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~400 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=1c94707c52387fe1418e1781be54942db327bbed;p=emacs.git * lisp/progmodes/etags.el (tags-completion-at-point-function): Avoid the error when point is inside the pattern. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7b1e1c52c6d..22a865d78ed 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-03-21 Sam Steingold + + * progmodes/etags.el (tags-completion-at-point-function): + Avoid the error when point is inside the pattern. + 2012-03-21 John Yates (tiny change) * progmodes/hideshow.el (hs-inside-comment-p): Fix hiding of first diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index cc5f0fef934..3a36410884f 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -809,10 +809,10 @@ If no tags table is loaded, do nothing and return nil." beg) (when pattern (save-excursion - (search-backward pattern) ;FIXME: will fail if we're inside pattern. - (setq beg (point)) - (forward-char (length pattern)) - (list beg (point) (tags-lazy-completion-table) :exclusive 'no)))))) + (when (search-backward pattern nil t) ; will fail inside pattern + (setq beg (point)) + (forward-char (length pattern)) + (list beg (point) (tags-lazy-completion-table) :exclusive 'no))))))) (defun find-tag-tag (string) "Read a tag name, with defaulting and completion."